from wcs.libs.players import players
from wcs.libs.items import items

itemName = 'Off the Shell Boots'
item = items.addItem(itemName)
item.setGroup("enhancement")
item.setCost(200)
item.setDescription("Thick leather boots. +50 armor")
item.aliveToUse = True
item.setMaxCount(2)

def wcs_item_bought(event_var):
    """
    Executed when an item has been purcahsed. If the item brought was this item,
    then add the additional armor.
    """
    if event_var['item'] == itemName:
        userid = event_var["userid"]
        player = players[userid]
        player.armorAdd(50)
